package com.asia5b.a5mall.order.adapter

import com.asia5b.a5mall.middleware.model.shop.AbsGoodsModel

import com.asia5b.a5mall.middleware.utils.WImageLoader
import com.asia5b.a5mall.order.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Created by zhangyuncai on 2020/3/16.
 */
class OrderParcelGoodsAdapter(var list: ArrayList<AbsGoodsModel>) :
        BaseQuickAdapter<AbsGoodsModel, BaseViewHolder>(R.layout.goodsitem_orderparcel, list) {
    override fun convert(helper: BaseViewHolder, item: AbsGoodsModel) {
        WImageLoader.displayRoundImage(item.absGoodsImageUrl, helper.getView(R.id.iv_goods_img), 5)
    }

    override fun getItemCount(): Int {
        if (list.size > 4) {
            return 4
        }
        return super.getItemCount()
    }
}